#pragma once
#include <lcir/IR/Prototype.h>
#include <lcir/IR/Value.h>

#include <memory>

namespace lcir {
class Prototype;
class Type;
class Expression;
class VReg final : public ValueCRTP<VReg> {
  Expression *expr{nullptr};
 public:
  explicit VReg(std::unique_ptr<Prototype> proto, Expression *exprRef)
      : ValueCRTP(ValueKind::VK_VReg), expr(exprRef) {
   Value::proto = std::move(proto);
   Value::proto->setValue(this);
  }
  Expression *getDefExpr() const override { return expr; }

  static ValueKind getValueKind() { return ValueKind::VK_VReg; }

  explicit VReg() = delete;
  VReg(VReg &&other) = delete;
  VReg &operator=(VReg &&other) = delete;
  VReg(const VReg &other) = delete;
  VReg &operator=(const VReg &other) = delete;
  ~VReg() = default;
};

};  // namespace lcir